package com.pay.common.enums;

/**
 * 支付渠道枚举
 */
public enum PayWayEnum {

    ALIPAY_QRCODE_PAY("alipay.qrcode.pay","支付宝扫码支付"),
    WECHAT_H5_PAY("wechat.h5.pay","支付宝手机网页支付"),
    ALIPAY_PAGE_PAY("alipay.page.pay","支付宝PC网页支付"),

    WECHAT_QRCODE_PAY("wechat.qrcode.pay","微信扫码支付"),
    ICBC_NETBANK_PAY("icbc.netbank_pay","工行网银支付");



    private String code;

    private String msg;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }


    PayWayEnum(String code , String msg){
        this.code = code;
        this.msg = msg;
    }


    /**
     * 根据code获取msg
     * @param code
     * @return
     */
    public String  getMsg(String code){

        for (PayWayEnum payWayEnum :PayWayEnum.values()){

            if (code.equals(payWayEnum.getCode())){

                return payWayEnum.getMsg();
            }

        }

        return null;
    }



}
